﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReceiptDetail.aspx.cs"
    Inherits="SalesManagement.Modules.Sales.ReceiptDetail" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Viewport ID="ViewPort1" runat="server" Layout="RowLayout">
        <Items>
            <ext:Toolbar ID="Toolbar1" runat="server">
                <Items>
                    <ext:Button ID="btnNew" runat="server" Icon="PageAdd" Text="Tạo mới">
                    </ext:Button>
                    <ext:Button ID="Button3" runat="server" Icon="Disk" Text="Lưu" Disabled="true">
                    </ext:Button>
                    <ext:Button ID="btnCancel" runat="server" Icon="Cancel" Text="Bỏ qua">
                    </ext:Button>
                    <ext:Button ID="btnDelete" runat="server" Icon="Delete" Text="Xóa">
                    </ext:Button>
                    <ext:Button ID="btnPrinter" runat="server" Text="In" Icon="Printer" Disabled="false">
                    </ext:Button>
                </Items>
            </ext:Toolbar>
            <ext:Panel ID="Panel2" runat="server" Frame="true" Height="150" Layout="FormLayout"
                LabelWidth="120">
                <Items>
                    <ext:Panel ID="pnlFlexEven" runat="server" Layout="HBoxLayout" LabelWidth="60" AnchorHorizontal="50%">
                        <Defaults>
                            <ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
                        </Defaults>
                        <LayoutConfig>
                            <ext:HBoxLayoutConfig Padding="2" Align="Middle" />
                        </LayoutConfig>
                        <Items>
                            <ext:TextField ID="TextField2" runat="server" FieldLabel="Số phiếu" LabelWidth="110"
                                Flex="1" />
                            <ext:DateField ID="DateField1" runat="server" FieldLabel="Ngày" Flex="1" LabelWidth="50" />
                        </Items>
                    </ext:Panel>
                    <ext:Panel ID="Panel1" runat="server" Layout="HBoxLayout" LabelWidth="70" AnchorHorizontal="100%">
                        <Defaults>
                            <ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
                        </Defaults>
                        <LayoutConfig>
                            <ext:HBoxLayoutConfig Padding="2" Align="Middle" />
                        </LayoutConfig>
                        <Items>
                            <ext:ComboBox ID="cbInputMethod" runat="server" FieldLabel="Phương thức TT" Flex="1"
                                LabelWidth="110">
                                <Items>
                                    <ext:ListItem Text="Tiền mặt" Value="hcm" />
                                    <ext:ListItem Text="Chuyển khoản" Value="hn" />
                                </Items>
                                <SelectedItem Value="hcm" />
                            </ext:ComboBox>
                            <ext:ComboBox ID="ComboBox1" runat="server" TriggerAction="All" FieldLabel="Lý do thu"
                                Flex="1">
                                <Items>
                                    <ext:ListItem Text="Thu công nợ" Value="hcm" />
                                    <ext:ListItem Text="..." Value="hn" />
                                </Items>
                                <SelectedItem Value="hcm" />
                            </ext:ComboBox>
                        </Items>
                    </ext:Panel>
                    <ext:Panel ID="Panel3" runat="server" Layout="HBoxLayout" LabelWidth="70" AnchorHorizontal="100%">
                        <Defaults>
                            <ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
                        </Defaults>
                        <LayoutConfig>
                            <ext:HBoxLayoutConfig Padding="2" Align="Middle" />
                        </LayoutConfig>
                        <Items>
                            <ext:ComboBox ID="ComboBox2" FieldLabel="Khách hàng" runat="server" TriggerAction="All"
                                Flex="1" LabelWidth="110" />
                            <ext:TextField ID="txtMST" runat="server" FieldLabel="MST" Flex="1" />
                        </Items>
                    </ext:Panel>
                    <ext:Panel ID="Panel6" runat="server" Layout="HBoxLayout" LabelWidth="110" AnchorHorizontal="100%">
                        <Defaults>
                            <ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
                        </Defaults>
                        <LayoutConfig>
                            <ext:HBoxLayoutConfig Padding="2" Align="Middle" />
                        </LayoutConfig>
                        <Items>
                            <ext:TextField ID="TextField1" runat="server" FieldLabel="Địa chỉ" Flex="1" />
                        </Items>
                    </ext:Panel>
                    <ext:Panel ID="Panel5" runat="server" Layout="HBoxLayout" LabelWidth="70" AnchorHorizontal="50%">
                        <Defaults>
                            <ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
                        </Defaults>
                        <LayoutConfig>
                            <ext:HBoxLayoutConfig Padding="2" Align="Middle" />
                        </LayoutConfig>
                        <Items>
                            <ext:NumberField ID="NumberField1" runat="server" FieldLabel="Số tiền thu" LabelWidth="110"
                                Flex="1">
                            </ext:NumberField>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Panel>
            <ext:Panel ID="Panel4" runat="server" Layout="HBoxLayout" Height="40" Frame="true">
                <Items>
                    <ext:RadioGroup ID="RadioGroup1" runat="server" Width="300">
                        <Items>
                            <ext:Radio ID="Radio1" runat="server" BoxLabel="Hoạch toán tự dộng">
                            </ext:Radio>
                            <ext:Radio ID="Radio2" runat="server" BoxLabel="Hoạch toán bằng tay">
                            </ext:Radio>
                        </Items>
                    </ext:RadioGroup>
                    <ext:Button runat="server" ID="btnAction" Text="Thực hiện" Height="26">
                    </ext:Button>
                </Items>
            </ext:Panel>
            <ext:GridPanel ID="grDetail" runat="server" AutoExpandColumn="clNote" Border="false"
                RowHeight="1">
                <Store>
                    <ext:Store ID="Store2" runat="server">
                        <Reader>
                            <ext:JsonReader IDProperty="pro_id">
                                <Fields>
                                    <ext:RecordField Name="pro_id" />
                                    <ext:RecordField Name="pro_Name" />
                                    <ext:RecordField Name="pro_Unit" />
                                    <ext:RecordField Name="pro_Amount" />
                                    <ext:RecordField Name="pro_Price" />
                                    <ext:RecordField Name="pro_VAT" />
                                    <ext:RecordField Name="pro_Acounting" />
                                    <ext:RecordField Name="Amount" />
                                    <ext:RecordField Name="TotalAmount" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel2" runat="server">
                    <Columns>
                        <ext:Column DataIndex="pro_Unit" Header="Ngày nhập" />
                        <ext:Column DataIndex="pro_Amount" Header="Chứng từ xuất" />
                        <ext:Column ColumnID="Amount" DataIndex="Amount" Header="Tiền phải thu" />
                        <ext:Column ColumnID="TotalAmount" DataIndex="TotalAmount" Header="Tiền thanh toán" />
                        <ext:Column DataIndex="clNote" Header="Chi chú" />
                    </Columns>
                </ColumnModel>
                <Listeners>
                    <ColumnResize Handler="updateTotal(#{grDetail});" Delay="10" />
                    <AfterRender Handler="updateTotal(#{grDetail});" Delay="10" />
                </Listeners>
                <BottomBar>
                    <ext:Toolbar ID="Toolbar2" runat="server">
                        <Items>
                            <ext:DisplayField ID="DisplayField3" runat="server" DataIndex="pro_Unit" Text=" " />
                            <ext:DisplayField ID="DisplayField1" runat="server" DataIndex="pro_Amount" Text=" " />
                            <ext:DisplayField ID="DisplayField2" runat="server" DataIndex="Amount" Cls="total-field"
                                Text="0" />
                            <ext:DisplayField ID="ColumnField1" runat="server" DataIndex="TotalAmount" Cls="total-field"
                                Text="0" />
                        </Items>
                    </ext:Toolbar>
                </BottomBar>
            </ext:GridPanel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
